<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker,ace-style"></t:base>

<t:datagrid name="ptypeList"  actionUrl="pTypeController.do?ptypeGrid" idField="id" treegrid="true" pagination="false" fitColumns="true">
	<t:dgCol title="ID" field="id" treefield="id" hidden="true"></t:dgCol>
	<t:dgCol title="分类名称" field="name" treefield="text" width="120"></t:dgCol>
	<t:dgCol title="分类描述" field="description" treefield="src" width="120"></t:dgCol>
	<t:dgCol title="操作" field="opt" width="120"></t:dgCol>
	<t:dgDelOpt url="pTypeController.do?del&id={id}" title="删除"></t:dgDelOpt>
	<t:dgToolBar title="增加" icon="icon-add" url="pTypeController.do?addorupdate" funname="addFun"></t:dgToolBar>
	<t:dgToolBar title="编辑" icon="icon-edit" url="pTypeController.do?addorupdate" funname="update"></t:dgToolBar>
</t:datagrid>


<script type="text/javascript">
$(function() {
	var li_east = 0;
});
function addFun(title,url, id) {
	var rowData = $('#'+id).datagrid('getSelected');
	if (rowData) {
		url += '&parentId.id='+rowData.id;
	}
	add(title,url,'ptypeList');
}
</script>

